﻿<Tree Items="@CheckedItems" ShowCheckbox="true" OnTreeItemChecked="@OnTreeItemChecked" />
<ConsoleLogger @ref="Logger" class="mt-3" />

@code {
    [NotNull]
    private ConsoleLogger? Logger { get; set; }

    private List<TreeItem> CheckedItems { get; set; } = GetCheckedItems();

    private static List<TreeItem> GetCheckedItems()
    {
        var ret = TreeDataFoo.GetTreeItems();
        ret[1].Items[1].Checked = true;
        return ret;
    }

    private Task OnTreeItemChecked(List<TreeItem> items)
    {
        Logger.Log($"Currently selected {items.Count} item");
        return Task.CompletedTask;
    }
}
